<!DOCTYPE html>
<html lang="en">
<meta>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
<title>星座解读</title>
<meta name="description" content="#准了app#星盘解读分享页">
<link rel="stylesheet" href="/static/astro_explain_new/css/astro.css">
<link rel="stylesheet" href="/static/astro_explain_new/css/mini.css">
</head>
<body id="body" style="visibility: hidden;">
<div>
    <div class="head-wrap">
        <div class="common-wrap">
            <div class="common">
                <div class="head-left">
                    <img src="{$oss}/astro_explain_new/images/up.png" class="head-pic">
                </div>
                <div class="astro-title">{$data[2]['planet']['name']}{$data[2]['sign']['name']}</div>
                <div class="astro-intro">{$smrData[0]['riseIntro']}</div>
                <div class="star">
                    <!--                    <img src="{$oss}/astro_explain_new/images/star.png">-->

                </div>
            </div>
            <div class="common">
                <div class="head-center">
                    <img src="{$oss}/astro_explain_new/images/sun.png" class="head-pic">
                </div>
                <div class="astro-title">{$data[0]['planet']['name']}{$data[0]['sign']['name']}</div>
                <div class="astro-intro">{$smrData[1]['sunIntro']}</div>
                <div class="star">

                    <!--                    <img src="{$oss}/astro_explain_new/images/star.png">-->
                    <!--                    <img src="{$oss}/astro_explain_new/images/star.png">-->
                    <!--                    <img src="{$oss}/astro_explain_new/images/star.png">-->
                    <!--                    <img src="{$oss}/astro_explain_new/images/star.png">-->
                    <!--                    <img src="{$oss}/astro_explain_new/images/star.png">-->

                </div>
            </div>
            <div class="common">
                <div class="head-right">
                    <img src="{$oss}/astro_explain_new/images/moon.png" class="head-pic">
                </div>
                <div class="astro-title">{$data[1]['planet']['name']}{$data[1]['sign']['name']}</div>
                <div class="astro-intro">{$smrData[2]['moonIntro']}</div>
                <div class="star">

                    <!--                    <img src="{$oss}/astro_explain_new/images/star.png">-->
                    <!--                    <img src="{$oss}/astro_explain_new/images/star.png">-->
                    <!--                    <img src="{$oss}/astro_explain_new/images/star.png">-->

                </div>
            </div>
        </div>
    </div>
    <div class="content">
        <div class="content-wrap">
            {foreach name="data" item="value" key="key"}
            <div class="content-common">
                <div class="line"></div>
                <div class="content-title">{$value.planet.name}{$value.sign.name}</div>
                <div class="title-bg"><img src="{$oss}{$value.sign.sign_icon}"></div>
                <div class="content-word">{$value.sign.sing_text}
                </div>
            </div>
            {/foreach}
            <div class="content-footer"></div>
        </div>
    </div>
    <div class="footer">
    </div>
    <div class="bottom_con">
        {foreach name="natal_goods" item="v" key="key"}
        <div class="good_con" onclick="clickGoodsItem('{$v.status}')">
            <img class="bg_img" src="{$oss}{$v.bg_img}">
            <div class="btn_status" style="background:{$v.btn_color}">{$v.btn}</div>
            <div className='num_con'>
                <div className='iconfont iconbuy icon'></div>
                <div className='num'>{$v.unlock_num}</div>
            </div>
        </div>
        {/foreach}
    </div>
</div>
<!--</div>-->
<!--</div>-->
<!-- JQ -->
<script src="/static/astro_explain_new/js/jquery-1.11.3.min.js"></script>
<script src="/static/astro_explain_new/js/rem.js"></script>

<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>

<script>

    // web-view下的页面内
    // function ready() {
    //     console.log(window.__wxjs_environment === 'miniprogram') // true
    //     wx.miniProgram.postMessage({data: 'mark'})
    // }
    //
    // if (!window.WeixinJSBridge || !WeixinJSBridge.invoke) {
    //     document.addEventListener('WeixinJSBridgeReady', ready, false)
    // } else {
    //     ready()
    // }
    //
    // // 或者
    // wx.miniProgram.getEnv(function (res) {
    //     console.log(res.miniprogram) // true
    // })


    window.onload = function () {
        console.log('mark test in zhunle_api')
        console.log('is weapp=' + (window.__wxjs_environment === 'miniprogram')) // true
        // 阻止双击放大
        var lastTouchEnd = 0;
        document.addEventListener('touchstart', function (event) {
            if (event.touches.length > 1) {
                event.preventDefault();
            }
        });
        document.addEventListener('touchend', function (event) {
            var now = (new Date()).getTime();
            if (now - lastTouchEnd <= 300) {
                event.preventDefault();
            }
            lastTouchEnd = now;
        }, false);

        // 阻止双指放大
        document.addEventListener('gesturestart', function (event) {
            event.preventDefault();
        });
    }//苹果手机禁止缩放

    // function commonJsToNative(target, link) {
    //     if (!target)
    //         return;
    //
    //     switch (app_type) {
    //         case 'ios':
    //             window.webkit.messageHandlers.commonJsToNative.postMessage({
    //                 'target': target,
    //                 'link': link
    //             });
    //             break;
    //         case 'android':
    //             console.log('android')
    //             androidwebview.commonJsToNative(target, link)
    //             break;
    //         default:
    //             console.log('not ios or android')
    //             if ('link' == target) {
    //                 window.location.href = link
    //             }
    //     }
    // }

    function clickGoodsItem(status) {
        //status 解锁状态 0未解锁 1解锁中 2已解锁 3未开放
        console.log('clickGoodsItem status=' + status)
        wx.miniProgram.postMessage({data: 'clickGoodsItem1 status=' + status})
        // wx.miniProgram.navigateBack()
        // wx.miniProgram.redirectTo({url: '/pages/natal_report/index'})

        wx.miniProgram.navigateTo({url: '/pages/natal_report/index'})


        // switch (status) {
        //     case 0: {
        //         //跳转到本命报告下单页面
        //         wx.miniProgram.postMessage({data: 'clickGoodsItem0 status=' + status})
        //         // wx.miniProgram.navigateTo({url: '/pages/pay_order/index'})
        //         break
        //     }
        //     case 1: {
        //         // showToast('正在计算中，请稍后查看！')
        //         break
        //     }
        //     case '2': {
        //         console.log('postMessage to wx mini test')
        //         wx.miniProgram.postMessage({data: 'clickGoodsItem2 status=' + status})
        //         // wx.miniProgram.navigateTo({url: '/pages/home/index'})
        //         // window.webkit.miniProgram.postMessage('mark')
        //         // wx.miniProgram.postMessage({
        //         //     'target': target,
        //         //     'link': link
        //         // })
        //         // let url = URL_NATAL_REPORT_DETAIL + '?rid=' + getRid() + '&gid=' + data.gid
        //         // Log('url=' + url)
        //         // goToCommonPage(PAGE.WEBVIEW, {
        //         //     title: encodeURIComponent('本命报告'),
        //         //     url: encodeURIComponent(url)
        //         // })
        //         break
        //     }
        //     case 3: {
        //         // showToast('敬请期待！')
        //         break
        //     }
        // }
    }


</script>
</body>
<script type="text/javascript">
    document.getElementById('body').style.visibility = "visible";
</script>
{include file="../apps/web/view/public/sensors.html" /}
</html>
